const db = wx.cloud.database()
Page({
    data: {
        typeList:[],//菜谱分类数据
    },
    onLoad(){
        this._getAllRecipeTypeList()
    },
    _goToRecipeList(e){//跳转到菜谱列表页面，需要传递菜谱分类的id和菜谱中午名称
        let {id,name} = e.currentTarget.dataset

        wx.navigateTo({
          url: `../recipelist/recipelist?id=${id}&name=${name}`,
        })
    },
    async _getAllRecipeTypeList(){//获取所有正常的菜谱分类
        let recipesType = await db.collection('re-recipeType').where({
            status:1
        }).get()
        // console.log(recipesType,"铂光金")
        this.setData({
            typeList:recipesType.data
        })
    }
})